package com.example.yuejian.yuejian.bean;

import com.google.gson.Gson;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Administrator on 2017/9/26.
 */

public class Question {


    /**
     * id : 1
     * uid : 1
     * qcontent : 击剑有什么好？
     * mid : 1
     * data : 2017-09-26
     * username : 朔朔
     */

    private int id;
    private int uid;
    private String qcontent;
    private int mid;
    private String data;
    private String username;

    public static Question objectFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);

            return new Gson().fromJson(jsonObject.getString(str), Question.class);
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setUid(int uid) {
        this.uid = uid;
    }

    public void setQcontent(String qcontent) {
        this.qcontent = qcontent;
    }

    public void setMid(int mid) {
        this.mid = mid;
    }

    public void setData(String data) {
        this.data = data;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public int getId() {
        return id;
    }

    public int getUid() {
        return uid;
    }

    public String getQcontent() {
        return qcontent;
    }

    public int getMid() {
        return mid;
    }

    public String getData() {
        return data;
    }

    public String getUsername() {
        return username;
    }
}
